# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-lingva
pkgver=0_git20230801
_gitrev=2667e33cf3524d07cf437dac9380371890efcb15
pkgrel=0
_pkgreal=lingva
pkgdesc="Basic interface to Lingva (Google Translate alternative front-end)"
url="https://codeberg.org/martianh/lingva.el"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="$pkgname-$_gitrev.tar.gz::https://codeberg.org/martianh/lingva.el/archive/$_gitrev.tar.gz"
builddir="$srcdir/lingva.el"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
362ecc09e5eadbfcab07af114b7d9e410315284a69b7e37d342575ec6653ace351758cdb337c9d22b05c9760ebfc0fa9762f76c3f61e210958719ca51c125477  emacs-lingva-2667e33cf3524d07cf437dac9380371890efcb15.tar.gz
"
